-- demon_statue
-- create by panyl
-- 进入迷宫时魔神雕像处理

return {
    apply = function(prop, baseValue)
        -- 提升的值
        return prop[3];
    end,

    -- 进入迷宫触发
    trigger = function(who, prop, enter)
        local class = prop[2];
        local level = tonumber(prop[3]);
        local exp   = DemonStatueM.queryStatue(class, level)["exp"];

        local demonExp = ME.user.dbase:query("demon_exp", {});
        local curExp = demonExp[class] or 0;

        -- 如果当前等级已经超过level，说明已经奖励过了
        if exp <= curExp then
            return false;
        end

        -- 升级
        DemonStatueM.tryUpgrade(exp, class);

        return true;
    end,

    record = function(target, prop, path)
        return false;
    end
};
